/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Common;

import Forms.MainForm;
import NetworkRequests.*;
import Enum.ConnectType.*;

/**
 *
 * @author Hmong
 */
public class NetworkManager {
    
    public static int ConnectSuccessfulType = 0;
    public static int ConnectTestedType = 0;

    private static final byte[] _LockObj = new byte[0];  // 特殊的instance变量

    public static void SetConnectTypeTested(int nType){
        synchronized(_LockObj){
            ConnectTestedType |= nType;
        }

        MainForm.GetInstance().ConnectTypeTested(nType);

        if (ConnectTestedType == ( CMWap.Http | CMNet.Socket | CMNet.Http))
            MainForm.GetInstance().ConnectTypeTestCompleted();
    }

    public static void TestConnectNetwork() {
        TestNetwork tn = new TestNetwork();
        tn.Start();
    }
}
